<?PHP
	require_once 'functions.php';

	session_start();

		if (!isset($_POST['user']) || empty($_POST['password'])) {
			die('blad logowania');
			}

		LogIn ($user, $password);
		
		if (login($_POST['user'],$_POST['password'])) {
				echo 'poprawne haslo';
				$_SESSION['logowanie janka']=array(
					'user'=>$_POST['user'],
					'loggedin'=>true,
					'time'=> time() + 20
				);
				header('location: strona.php');
			}
?>
